import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { createVNode } from 'vue';
export default function confirm(title, content, func, options = {}) {
    const {
        onOk = typeof func === 'function'?func :() => {},
        onCancel = () => console.log('Cancel'),
        okText = 'Yes',
        cancelText = 'No',
        okType = 'danger',
        okDisabled = false
    } = options;

    Modal.confirm({
        title,
        icon: createVNode(ExclamationCircleOutlined),
        content,
        okText,
        okType,
        cancelText,
        okButtonProps: {
            disabled: okDisabled
        },
        onOk,
        onCancel
    });
}